package com.jmpt.fangbohui.ui.holder;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.jmpt.fangbohui.R;
import com.jmpt.fangbohui.ui.base.BaseViewHolder;
import com.jmpt.fangbohui.utils.ImageLoaderHelper;
import com.jmpt.fangbohui.utils.UIUtils;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;

public class HorizontalImageItemHolder extends BaseViewHolder<String[]> {
	
	@ViewInject(R.id.iv_pic)
	private ImageView mIvPic;
	
	@ViewInject(R.id.tv_name)
	private TextView mTvName;

	public HorizontalImageItemHolder(Context context) {
		super(context);
	}

	@Override
	protected View initView() {
		View view = View.inflate(UIUtils.getContext(), R.layout.item_new_house_type_pic, null);
		ViewUtils.inject(this,view);
		return view;
	}

	@Override
	protected void refreshView(String[] data) {
		try {
			ImageLoaderHelper.displayImage(data[0], mIvPic);
			mTvName.setText(data[1]);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
